package com.qf.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//配置拦截器拦截那些路径
@Configuration //配置类的专用注解
public class InterceptorConfig implements WebMvcConfigurer {
    @Autowired
    private ApiContInterceptor apiContInterceptor;
    @Override //配置拦路径
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(apiContInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/apicount");
    }
}
